define(function(require, exports, module) {
    "use strict";
    var $ = require("$"),
        app = require("dist/application/app"),
        config = app.config,
        method = app.method;
    require('./design');
    require('./template');
    require('./menu');
    var config_panel = require("./config");
    $(document).on("click", ".js_page_edit_submit", function() {
        var $this = $(this),
            $form = $this.closest("form"),
            $js_no_submit_template = $(".js_no_submit_template", $form);
        var $check = $("input[type='radio']:checked", $js_no_submit_template);
        if (!$check.length) {
            config.msg.error("请选择模版");
            return false;
        }
    });
    if($("form.design-form-special").length){
        config_panel.init($("form.design-form-special"));
    }
    window.pagePrevModal = function(path) {
        $('#ajaxModal').remove();
        var $modal = $('<div class="modal fade" id="ajaxModal"><div class="modal-body "></div></div>');
        $(document).append($modal);
        $modal.modal();
        $.ajax(path, {
            type: "get",
            dataType: "html",
            data: {}
        }).done(function(result) {
            $modal.append2(result, function() {
                var $form = $('form.form-validate', $modal);
                $form.length > 0 && require.async("dist/form/init", function(form) {
                    if ($("button[type='submit']", $modal).length) {
                        $("button[type='submit']", $modal).removeAttr('disabled');
                    }
                    form.init($form);
                });
            });
        })
    }



})